import request from './index';

// 用户注册
export const userRegister = function (params: object) {
  return request.post('/user/register', params)
}

// 用户登录
export const userLogin = function (params: object) {
  return request.post('/user/login', params)
}

// 获取用户列表
export const getUserList = function () {
  return request.get('/user/list')
}



// 新增图书
export const createBook = function (params: object) {
  return request.post('/book/create', params)
}

// 删除图书
export const delBook = function (params: object) {
  return request.post('/book/del', params)
}

// 修改图书
export const updateBook = function (params: object) {
  return request.post('/book/update', params)
}

// 查询图书
export const getBookList = function (params: object) {
  return request.post('/book/list', params)
}



// 获取借阅记录列表
export const getBorrowList = function () {
  return request.get('/borrow/list')
}

// 借书
export const borrowBook = function (params: object) {
  return request.post('/borrow/borrowBook', params)
}

// 还书
export const returnBook = function (params: object) {
  return request.post('/borrow/returnBook', params)
}



// 添加书本位置
export const addBookLocation = function (params: object) {
  return request.post('/location/add', params)
}

// 修改书本位置
export const changeBookLocation = function (params: object) {
  return request.post('/location/change', params)
}

// 获取书本位置列表
export const getBookLocation = function (params: object) {
  return request.post('/location/get', params)
}



// 发评论
export const reviewBook = function (params: object) {
  return request.post('/review/add', params)
}

// 获取评论列表
export const getReviewBookList = function () {
  return request.get('/review/list')
}
